<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Document</title>
<link rel="stylesheet" href="/layui/css/layui.css">
<script src="/layui/layui.js"></script>
<link rel="stylesheet" href="/css/register.css">
</head>
<body>
   <div class="content layui-form">
    <h1 class="title">博客系统注册</h1>
    <span style="display: block;width: 100px;margin:0 auto">已有账号?<a href="{:U('Index/login')}">登入</a></span>
    <div class="content-form layui-form">
     <form class="layui-form" action="pass/doregister" method="post">
          <div class="layui-form-item">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-block">
              <input type="text" name="username" lay-verify="required|username" autocomplete="off" placeholder="请填写用户名" class="layui-input">
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">手机号</label>
            <div class="layui-input-block">
              <input type="text" name="phone" lay-verify="required|phone" placeholder="请输入" autocomplete="off" class="layui-input phone">
            </div>
          </div>   
          <div class="layui-form-item">
            <label class="layui-form-label">邮箱号</label>
            <div class="layui-input-block">
              <input type="text" name="email" lay-verify="required|email" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
          </div> 
          <div class="layui-form-item">
            <label class="layui-form-label">密码</label>
            <div class="layui-input-block">
              <input type="password" name="password" lay-verify="required|pass" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">确认密码</label>
            <div class="layui-input-block">
              <input type="password" name="repassword" lay-verify="required|repass" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
           </div> 
          <div class="layui-form-item" pane="">
            <label class="layui-form-label">单选框</label>
            <div class="layui-input-block">
              <input type="radio" name="sex" value="男" title="男" checked="">
              <input type="radio" name="sex" value="女" title="女">
            </div>
          </div>
          <div class="layui-form-item">
            <div class="layui-input-block">
              <button class="layui-btn" lay-submit="" lay-filter="demo1">注册</button>
              <button type="reset" class="layui-btn layui-btn-primary">重置</button>    
          </div>      
     </form>
    </div>
   </div>
</body>
</html>
<script src="/layui/layui.js"></script>
<script>
layui.use(['form', 'layedit', 'laydate', 'jquery'], function(){
    var form = layui.form()
    ,layer = layui.layer
    ,layedit = layui.layedit
    ,laydate = layui.laydate
    ,$ = layui.jquery;
    form.verify({
        username: function(value){
          if(value.length < 6){
            return '用户名至少得6个字符啊';
          }
        }
        ,pass: [/(.+){6,12}$/, '密码必须6到12位']
        ,repass: function(value) {
            if(value != $('input[name="password"]').val()){
                return '两次输入的密码需要一致';
         }
        }
     });
        
});


</script>